<template>
  <div class="radio-group">
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: 'RadioGroup',
  props: {
    value: {
      type: [String, Number],
      default: ''
    },
    disabled: {
      type: Boolean,
      default: false
    }
  },

  data () {
    return {
      val: this.value
    }
  },

  watch: {
    value (newVal) {
      this.val = newVal
    }
  },

  created () {
    this.$on('change', (newVal) => {
      this.val = newVal
      this.$emit('input', newVal)
    })
  }
}
</script>

<style lang="scss" scoped>
.radio-group {
  @include wh(100%, 100%);
  @include flex(row, flex-end, center);
}
</style>
